<%@page session="false" language="java" contentType="text/html; charset=GBK" pageEncoding="GBK"%>
<%@page import="cn.pconline.security2.authentication.*" %>
<%@page import="cn.pconline.security2.authorization.*" %>
<%@page import="cn.pconline.passport2.*" %>
<%@page import="cn.pconline.activity.util.*" %>
<%@page import="cn.pconline.activity.domain.*" %>
<%@page import="cn.pconline.activity.service.*" %>
<%
UserInfo userInfo = Client.authResult(request);
if (userInfo != null) {
	if ( ! Facade.isApplicationUser(userInfo.getId())) {
		throw new SecurityException("you are not the application's user");
	}

	Facade.saveSession(request.getParameter("st"), userInfo, request, response);
	if (userInfo.getParttime()) {
		response.sendRedirect(request.getContextPath() + "/");
	} else {
		response.sendRedirect(request.getContextPath() + "/admin/");
	}
} else {
	throw new SecurityException();
}
%>
